<?php


class Entity {
	
	var $messages = null;
	
	function __construct() {
		$this->messages = array();
	}
	
	
	/**
	 * Add a new message
	 */
	function addMessage($message) {
		$this->messages[] = array("type" => $message[type], "text" => $message[text], "code" => $message[code]);		
	}
	
	
	/**
	 * Fetch todos los registros
	 * @param List $values
	 */
	function fetch($result) {
		$values = array();
		while($value = mysql_fetch_assoc($result))
			$values[] = $value;
		return $values;
	}
	
}